package com.ccrfid.rmc6.repository.device;

import com.ccrfid.rmc6.entity.device.LocatorEntity;
import com.ccrfid.rmc6.repository.search.SearchableRepository;
import org.springframework.data.repository.Repository;

import java.util.List;

public interface LocatorRepository extends Repository<LocatorEntity, Long>, SearchableRepository<LocatorEntity> {
    //
    List<LocatorEntity> getAllBy();
    //
    LocatorEntity getById(Long id);
    LocatorEntity getByLocatorAddress(Integer locatorAddress);
    //
    Boolean existsById(Long id);
    Boolean existsBySn(String sn);
    Boolean existsByLocatorAddress(Integer locatorAddress);
    Boolean existsBySnAndIdNot(String sn, Long id);
    Boolean existsByLocatorAddressAndIdNot(Integer locatorAddress, Long id);
    //
    LocatorEntity save(LocatorEntity entity);
    //
    void deleteByIdIn(List<Long> idList);
}
